<?php

class Tag_Rightnav{
	static $XSL;
}

Tag_Rightnav::$XSL = <<<EOD
<xsl:template name="item">
<xsl:param name="node"/>
<li>
<xsl:if test="\$node/@selected='true'">
	<xsl:attribute name="class">
		rightsidebar-current-nav
	</xsl:attribute>
</xsl:if>
<div class="rightsidebar-manabar">
<xsl:for-each select="\$node/i:right-nav-tool">
<a href="#" title="{@title}" onclick="{@onclick}" class="{@icon}"></a>
</xsl:for-each>
</div>
<a href="{\$node/@url}"><xsl:value-of select="\$node/@label"/></a>
<xsl:if test="string-length(\$node/@description)">
<span class="rightsidebar-num">(<xsl:value-of select="\$node/@description"/>)</span>
</xsl:if>
</li>
<xsl:if test="count(\$node/i:right-nav-item)">
<li class="rightsidebar-nav2">
<ul class="rightsidebar-navul">
<xsl:for-each select="\$node/i:right-nav-item">
	<xsl:call-template name="item">
		<xsl:with-param name="node" select="."/>
	</xsl:call-template>
</xsl:for-each>
</ul>
</li>
</xsl:if>
</xsl:template>

<xsl:template match="i:right-nav">
<div class="rightsidebar">
	<div class="rightsidebar-header">
	<xsl:if test="count(./i:right-nav-link)">
	   <span><a href="{./i:right-nav-link/@url}" onclick="{./i:right-nav-link/@onclick}"><xsl:value-of select="./i:right-nav-link/@label"/></a></span>
	</xsl:if>
	   <xsl:value-of select="@label"/>
	</div>
	<div class="rightsidebar-content">
	<ul class="rightsidebar-navul">
	<xsl:for-each select="i:right-nav-item">
		<xsl:call-template name="item">
			<xsl:with-param name="node" select="."/>
		</xsl:call-template>
	</xsl:for-each>
	</ul>
	</div>
</div>
</xsl:template>
EOD;


